﻿@using DotNet.Edu.Service
@model List<CoursewareDetails>
@{
    Courseware entity = ViewBag.Courseware;
    string categoryId = ViewBag.WorkCategoryId;
    var category = EduService.EduCategory.Get(categoryId);
    string validateRandomRange = category.ValidateRandomRange;//AuthService.Param.Get("ValidateRandomRange", "600-900");
    string[] randomRange = validateRandomRange.Split('-');
    int validateTryTime = category.ValidateTryTime; //AuthService.Param.Get("ValidateTryTime", "3").ToInt();
    int validateTimeout = category.ValidateTimeout; //AuthService.Param.Get("ValidateTimeout", "60").ToInt();
    int validateRandomMin = randomRange[0].ToInt();
    int validateRandomMax = randomRange[1].ToInt();
}
<div class="page">
    <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left back" href="@Url.Action("Index")" data-transition='slide-out'>
            <span class="icon icon-left"></span> 返回
        </a>
        <h1 class="title">@StringHelper.SubStringB(entity.Name, 10)</h1>
    </header>

    <nav class="bar bar-tab" style="">
        <a class="tab-item active" href="#" style="text-align: left;padding-left: 0.5rem;">
            学习计时
            <strong id="totalTime" class="color-primary">
                00:00:00
            </strong>
        </a>

        <a id="b_signout" class="tab-item bg-primary" href="#" style="color:white">
            签退
        </a>
    </nav>

    <div class="content">

        @(entity.CourseType.Equals("1") ? Html.Partial("_Image", Model) : Html.Partial("_Video", Model))

    </div>
</div>
@section css{
    @Html.CdnImport("~/lib/mediaelement/mediaelementplayer.css")
    @Html.CdnImport("~/lib/mediaelement/mejs-skins.css")
    @Html.CdnImport("~/lib/swiper/swiper.css")
}
@section js{
    @Html.CdnImport("~/lib/mediaelement/mediaelement-and-player.js")
    @Html.CdnImport("~/lib/swiper/swiper.js")
    @Html.LocalImport("~/www/js/stu_learning.js")
    <script>
        $(function () {
            var swiper = new Swiper('.swiper-container', {
                nextButton: 'null',
                prevButton: 'null',
                pagination: 'null'
                //paginationClickable: false,
                //// Disable preloading of all images
                //preloadImages: true,
                //// Enable lazy loading
                //lazyLoading: false
            });

            //$(".swiper-container").swiper({
            //    pagination: '.swiper-pagination',
            //    paginationClickable: true
            //});
            $('video,audio').mediaelementplayer();
            init(@validateTryTime,@validateTimeout,@validateRandomMin,@validateRandomMax,'@entity.Id','@entity.Name');
        });
    </script>
}